package it.polimi.swimv2.remote;

import it.polimi.swimv2.entities.Suggestion;
import it.polimi.swimv2.exception.AbilityExistsException;
import it.polimi.swimv2.exception.SuggestionException;

import java.util.Collection;

import javax.ejb.Remote;

@Remote
public interface SuggestionManagerRemote {

	public Collection<Suggestion> getSuggestion();

	/**
	 * Creates a new ability suggestion
	 * @param sender
	 *            the username of the sender
	 * @param newAbility
	 * @throws SuggestionException
	 *             when newAbility is not valid or sender is not an username of
	 *             a registered User.
	 * @throws AbilityExistsException
	 *             when exists an Ability whose name is equal to newAbility,
	 */
	public void sendSuggestion(String sender, String newAbility)
			throws SuggestionException, AbilityExistsException;

	/**
	 * Accepts the specified suggestion: removes the suggestion from the
	 * database, and creates a new declarable ability with the name specified in
	 * the suggestion; if such Ability already exists it is not created.
	 * 
	 * @param id
	 */
	public void acceptSuggestion(Integer id);

	/**
	 * Removes the specified suggestion from the database.
	 * 
	 * @param id
	 *            the identifier of the suggestion
	 */
	public void refuseSuggestion(Integer id);
}
